//
//  MainViewController.m
//  TextApplication
//
//  Created by dllo on 16/8/26.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "MainViewController.h"
#import "StoryViewController.h"
#import "MagzineViewController.h"
#import "MasterViewController.h"
#import "ShareViewController.h"
#import "PersonalViewController.h"
#import "LoginViewController.h"

@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    // 创建一系列viewController
    
    [self createViewController];
    
}

- (void)createViewController {
    [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor grayColor]}];
    [[UITabBar appearance] setBarTintColor:[UIColor colorWithWhite:0.107 alpha:1.000]];
    [[UITabBar appearance] setSelectedImageTintColor:[UIColor whiteColor]];
    
    self.tabBarViewController = [[UITabBarController alloc] init];
    
    StoryViewController *storeVC = [[StoryViewController alloc] init];
    UINavigationController *storeNav = [[UINavigationController alloc] initWithRootViewController:storeVC];
    storeNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"商店" image:[UIImage imageNamed:@"14"] tag:1000];

    MagzineViewController *magazineVC = [[MagzineViewController alloc] init];
    UINavigationController *magazineNav = [[UINavigationController alloc] initWithRootViewController:magazineVC];
    magazineNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"杂志" image:[UIImage imageNamed:@"15"] tag:1001];

    MasterViewController *masterVC = [[MasterViewController alloc] init];
    UINavigationController *masterNav = [[UINavigationController alloc] initWithRootViewController:masterVC];
    masterNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"达人" image:[UIImage imageNamed:@"16"] tag:1002];

    ShareViewController *shareVC = [[ShareViewController alloc] init];
    UINavigationController *shareNav = [[UINavigationController alloc] initWithRootViewController:shareVC];
    shareNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"分享" image:[UIImage imageNamed:@"17"] tag:1003];

    PersonalViewController *personalVC = [[PersonalViewController alloc] init];
    UINavigationController *personalNav = [[UINavigationController alloc] initWithRootViewController:personalVC];
    personalNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"个人" image:[UIImage imageNamed:@"18"] tag:1004];

    self.tabBarViewController.viewControllers = @[storeNav, magazineNav, masterNav, shareNav, personalNav];
   
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
